//express_demo.js 文件
var express = require('express');
var url=require('url');    //URL解析模块
// var jade = require('jade')

var Log=require("./log");

var app = express();

app.set('views', '../view')
app.set('view engine', 'pug')
 
app.get('/', function (req, res) {
   res.render('index', { title: 'Hey', message: 'Hello there!'});
   Log.Log(url.parse(req.url).pathname)
})
 
var server = app.listen(8081, function () {
 
  var host = server.address().address
  var port = server.address().port
 
  console.log("应用实例，访问地址为 http://%s:%s", host, port)
 
})